package com.zzptc.lhl.myapplication.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.RecyclerView;

import com.bumptech.glide.Glide;
import com.zzptc.lhl.myapplication.R;
import com.zzptc.lhl.myapplication.databinding.RecipeItemBinding;
import com.zzptc.lhl.myapplication.entity.ResultsBean;

import java.util.List;

public class MyRrecyclerviewAdapter extends RecyclerView.Adapter<MyRrecyclerviewAdapter.ViewHolder> {
    private List<Readable>readableList;
    private Context Context;

    public MyRrecyclerviewAdapter(List<Readable> readableList, Context context) {
        this.readableList = readableList;
        this.Context = Context;
    }

    @NonNull
    @Override
    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
         RecipeItemBinding binding= DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()),
                R.layout.recipe_item,parent,false);
        return new ViewHolder(binding);
    }

    @Override//绑定数据
    public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
        Readable readable = readableList.get(position);
        

        }

    @Override
    public int getItemCount() {
        return readableList.size();
    }

    public class ViewHolder extends RecyclerView.ViewHolder {
        private RecipeItemBinding recipeItemBinding;
        public ViewHolder(@NonNull RecipeItemBinding recipeItemBinding) {
            super(recipeItemBinding.getRoot());
            this.recipeItemBinding=recipeItemBinding;
        }
    }
}
